package Test;

/**
 * @author 徐志荣
 * @date 2023/4/17 20:58
 */
public class Test2 {
    public static void main(String[] args) throws InterruptedException {
        for (int i = 0; i < 20; i++) {
            int j = i;
            Thread thread = new Thread(new Runnable() {
                @Override
                public void run() {
                    System.out.println(j);
                }

            });
            thread.start();
            thread.join();
        }
        System.out.println("ok");
    }
}
